# Maintainer: Keith Maxwell <keith.maxwell@gmail.com>
pkgname=py3-responses
pkgver=0.24.1
pkgrel=0
pkgdesc="Utility library for mocking out the requests Python library"
url="https://pypi.org/project/responses/"
arch="noarch"
license="Apache-2.0"
depends="
	py3-requests
	py3-toml
	py3-urllib3
	py3-yaml
	"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
checkdepends="
	py3-flake8
	py3-pytest
	py3-pytest-cov
	py3-pytest-localserver
	py3-werkzeug
	"
subpackages="$pkgname-pyc"
source="https://github.com/getsentry/responses/archive/$pkgver/responses-$pkgver.tar.gz"
builddir="$srcdir/responses-$pkgver"

replaces=py-responses # Backwards compatibility
provides=py-responses=$pkgver-r$pkgrel # Backwards compatibility

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest \
		--ignore responses/tests/test_responses.py \
		--ignore responses/tests/test_recorder.py
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
55d69430ab4ce5faa126e55a120630b5587f088571e6fadca8ff2cfe654dfbcfd06d038ae044e4c346e4258f23e0b1f0fb2915870a2d152afefe1c5c50d4e63e  responses-0.24.1.tar.gz
"
